package com.eudon.ai.agent.invoke;

import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.chat.model.ChatResponse;
import org.springframework.ai.chat.prompt.Prompt;
import org.springframework.boot.CommandLineRunner;

/**
 * @author eudon
 * @description TODO
 * @date 2025/8/7
 * @email syd19970616@gmail.com
 * @address <a href="https://gitee.com/eudon">Gitee</a>
 */
//@Component
public class DashScopeSpringAi implements CommandLineRunner {
    public final ChatModel dashScopeChatModel;

    public DashScopeSpringAi( ChatModel chatModel) {
        this.dashScopeChatModel = chatModel;
    }


    @Override
    public void run(String... args) throws Exception {
        ChatResponse call = dashScopeChatModel.call(new Prompt("你好，你是谁？"));
        System.out.print(call.getResult().getOutput().getText());

    }
}
